package de.tabuma.pm.htmlcontent.view;

import de.tabuma.lib.tabumaview;
import de.tabuma.pm.*;

import java.io.PrintWriter;
import java.util.*;
import java.util.logging.*;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author alefen
 */
public class view extends tabumaview {

    public view(String servlet, Hashtable parameter) {
        super(servlet,parameter);
    }

    @Override
    public void processRequest(ServletContext context, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
        String save = "save";
        out.println("<div class=\"wysiwygeditor\">");
        out.println("<script type=\"text/javascript\" src=\"openwysiwyg/wysiwyg.js\"></script>");
        out.println(getFormBeginn(constants.ProjectNavigationA));
        out.println(getHiddenAsAttribute());
        out.println("<textarea name=\""+constants.HtmlContentTextareaName+"\" id=\""+constants.HtmlContentTextareaName+"\" cols=\"40\" rows=\"3\">");
        out.println(request.getAttribute(constants.HtmlContentTextareaName));
        out.println("</textarea>");
        out.println("<script type=\"text/javascript\">");
        out.println("generate_wysiwyg('"+constants.HtmlContentTextareaName+"');");
        out.println("</script>");
        out.println("");
        out.println("<input type=\"submit\" class=\"button\" name=\"submit\" value=\""+save+"\"/>");
        out.println(getFormEnd());
        out.println("</div>");
    }
}
